package com.daisuxia.payRoute;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Map;

import com.daisuxia.web.pojo.Repayment;
import com.daisuxia.web.pojo.User;
import com.daisuxia.web.pojo.UserCardInfo;

/**
 * Created by dhl on 2017/5/18.
 */
//代扣系统管理管理
public class PayManager {

	private IPayCommons head;
	private IPayCommons last;

	//注册支付机构
	public void registerIPay(IPayCommons...iPayCommonses){
		for (IPayCommons ipay :iPayCommonses) {
			registerIPay(ipay);
		}
	}

	public void registerIPay(IPayCommons ipay){
		if(head==null){
			last = head = ipay;
		}else{
			last.setNextSuccessor(ipay);
			last = ipay;
		}
	}

	public Map handleOrder(Map map) throws IOException, URISyntaxException {
		return head.handleOrder(map);
	}

}
